home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / hydra_fcv0_38b.lha / hydra-fc / rexx / Hydra-FC.rexx
OS/2 REXX Batch file  |  1995-09-11  |  22KB  |  779 lines

  1. /* Hydracom-FastCall Port V0.38▀
  2.    Datum : 11.09.1995
  3.    Autor : Mxlprx / Deep Forest BBS */
  4.  
  5. signal on Syntax
  6.  
  7. /********* Verbindung mit Messageport *********/
  8.  
  9. parse arg Port Brett SerDevice baud unit
  10.  
  11. ADDRESS value "rexx_FastCall"||port
  12. options results
  13.  
  14. /***** Zeit- und Datumsvariablen einlesen *****/
  15.  
  16. ud=date(e)" "time()
  17. filedatum=substr(ud,1,2)||"."||substr(ud,4,2)||".19"||substr(ud,7,2)" "substr(ud,10,2)"."substr(ud,13,2)"."substr(ud,16,2)
  18. datum=substr(ud,1,2)"."substr(ud,4,2)".19"substr(ud,7,2)
  19. uhrzeit=substr(ud,10,8)
  20.  
  21. /********** Definition von sonstigen Variablen **********/
  22. cr=d2c(13)||d2c(10)
  23. cls=d2c(12)
  24. version="V0.38▀"
  25.  
  26. if ~exists("S:Hydra-FC.cfg") then do
  27.         send cls||cr"Konfigurationsfile nicht vorhanden!"cr||cr"Bitte dem Sysop Bescheid geben."
  28.         quit
  29.         exit
  30. end
  31.  
  32. open(Config,"S:Hydra-FC.cfg","R")
  33.     CheckDupe=readln(Config)
  34.     dtfile='"'readln(Config)'"'
  35.     pip=readln(Config)
  36.     ExtraULDL=readln(Config)
  37.     Hydradir=readln(Config)
  38.     Hydradir2=readln(Config)
  39.     readln(Config)
  40.     sopvtr=readln(Config)
  41. close(Config)
  42.  
  43. /********** REXXSupport.library ÷ffnen... **********/
  44.  
  45. IF ~SHOW('LIBRARIES','rexxsupport.library') THEN
  46.     IF ~ADDLIB('rexxsupport.library',0,-30,0) THEN do
  47.         send "Library nicht installiert -> Sysop Bescheid geben"
  48.         quit
  49.         exit
  50.     end
  51.  
  52. /************* ANSI-Farb-Variablen ************/
  53.  
  54. ANSI
  55. Emul=result
  56. if Emul="OFF" then signal NOANSI
  57.  
  58. /* ANSI-Farb-Variablen zuweisen */
  59.  
  60. ANSIFarben:
  61.   C1=""
  62.   C2=""
  63.   C3=""
  64.   C4=""
  65.   C5=""
  66.   C6=""
  67.   C7=""
  68.  Res=""
  69.   B0=""
  70.   B1=""
  71.   B2=""
  72.   B3=""
  73.   B4=""
  74.   B5=""
  75.   B6=""
  76.   B7=""
  77. signal weiter
  78.  
  79. /* Farb-Variablen bei Monochrom */
  80.  
  81. NOANSI:
  82.   C1=""
  83.   C2=""
  84.   C3=""
  85.   C4=""
  86.   C5=""
  87.   C6=""
  88.   C7=""
  89.  Res=""
  90.   B0=""
  91.   B1=""
  92.   B2=""
  93.   B3=""
  94.   B4=""
  95.   B5=""
  96.   B6=""
  97.   B7=""
  98.  
  99. weiter:
  100.  
  101. /********** Multilanguage Config **********/
  102.  
  103. /* Language 0 (here = english) */
  104.  
  105. title.0       =B4||C7"     HydraCom - FastCall Port "version" / (c) 1995 by Mxlprx / Sysop Deep Forest  "Res||cr
  106. nothyddir.0   =C2"This is no board for Hydra-Transfers!"cr||B4||C7"Please use the Hydra-board instead!"Res||cr||cr
  107. notenoughbc.0 =C2"Sorry, not enough byte-credits!"Res||cr||cr
  108. startxfer.0   =C7"Really start transfer? "C7"[ "C3||B4"Y"B0||C7"/"C2"N"C7" ] "Res
  109. yep.0         ="Y"
  110. inithyd.0     =C7||B1"Initiating Hydracom!"B0
  111. abort.0       =C1"^X to abort."Res||cr
  112. fincom.0      =C5"found incomplete uploads:"Res||cr
  113. contUL.0      =C2"Do you want to resume uploading? "Res
  114. delnow.0      =C2"Delete unfinished files? "Res
  115. deliUL.0      =C3"Deleting incomplete Uploads."Res
  116. noupps.0      ="No Uploaded Files!"
  117. lookatdir.0   =C3"Looking for uploaded files..."Res
  118. asksl.0       =C3"Do You want to download these files later?"Res
  119. contUL2.0     ="Do You want to continue uploading them later? "
  120. thanx.0          ="Thank You for using Hydra!"
  121. nosel.0       ="No Files selected!"
  122. dlspace.0     ="Your bytecredits are: "
  123. found.0          ="found: "
  124. foundentry.0  =C1"found entry! "cr||cr||C3"That file is/was already here!"cr||C5"Informing Sysop of your duplicate upload"C6"..."
  125. readsel.0     ="Reading Selectlist..."
  126. dupe.0        =C2"Dupe-Check "C7"initiated.."
  127. t1.0          ="#Hi, %a2"
  128. t2.0          ="#On %a5"
  129. t3.0          ="%a6 you have started to upload a File"
  130. t4.0          ="that could not be finished because of"
  131. t5.0          ="#a %a7carrier loss%a6 !"
  132. t6.0          ="The File is called:"
  133. t7.0          ="#%a1Remember! %a7This File can %a3ONLY%a7 be finished using Hydra!"
  134. of.0          ="of"
  135. dlsuccess.0   =C2"All files successfully downloaded! Have phun!"
  136. notdlyet.0    =C2"The following files haven't been downloaded yet:"
  137. badboard.0    =C6"This board is being used already! Please choose the other Hydra-board."cr||C2"Or just play an online-game right now :)"
  138.  
  139. /* Language 1 (here = german) */
  140.  
  141. title.1       =B4||C7"     HydraCom - FastCall Port "version"  /  (c) 1995 Mxlprx / Sysop Deep Forest   "Res||cr
  142. nothyddir.1   =C2"Dies ist kein Brett fⁿr Hydra-Transfers!"cr||B4||C7"Bitte benutze anstelle diesem das Hydra-Brett!"Res||cr||cr
  143. notenoughbc.1 =C2"Du hast nicht genug Download-Freiraum!"Res||cr||cr
  144. startxfer.1   =C7"Wirklich die ▄bertragung starten? "C7"[ "C3||B4"J"B0||C7"/"C2"N"C7" ] "Res
  145. yep.1         ="J"
  146. inithyd.1     =C7||B1"Hydracom wird gestartet!"B0
  147. abort.1       =C1"Abbruch mit CTRL-X."Res||cr
  148. fincom.1      =C5"UnvollstΣndige Uploads gefunden:"Res||cr
  149. contUL.1      =C2"M÷chtest Du diese Files weiter uploaden? "Res
  150. delnow.1      =C2"Sollen die unvollstΣndigen Files gel÷scht werden? "Res
  151. deliUL.1      =C3"L÷sche die unvollstΣndigen Uploads..."Res
  152. noupps.1      ="Keine Uploads vorhanden!"
  153. lookatdir.1   =C3"Suche nach Uploads..."Res
  154. asksl.1       =C3"M÷chtest Du diese Files spΣter downloaden?"Res
  155. contUL2.1     ="Willst Du diese Files spΣter weiter uploaden? "
  156. thanx.1       ="Vielen Dank fⁿr die Benutzung von Hydra!"
  157. nosel.1          ="Keine Files gemerkt!"
  158. dlspace.1     ="Dein Downloadfreiraum betrΣgt: "
  159. found.1       ="gefunden: "
  160. foundentry.1  =C1"Eintrag gefunden! "cr||cr||C3"Dieses File ist/war bereits hier!"cr||C5"Informiere Sysop von Deinem Doppel-Upload"C6"..."cr||cr
  161. readsel.1     ="Lese Merk-Liste..."
  162. dupe.1        =C2"Dupe-Check "C7"gestartet.."
  163. t1.1          ="#Hallo, %a2"
  164. t2.1          ="#Du hast am %a5"
  165. t3.1          ="%a6 begonnen, ein File zu uploaden,"
  166. t4.1          ="#da▀ wegen eines %a7Carrierverlustes%a6 nicht"
  167. t5.1          ="fertig geuppt werden konnte !"
  168. t6.1          ="Das File hei▀t:"
  169. t7.1          ="#%a1Achtung! %a7Dieses File kann %a3NUR%a7 mit Hydra weiter geuppt werden !"
  170. of.1          ="von"
  171. dlsuccess.1   =C2"Alle Files wurden erfolgreich downgeloadet! Viel Spa▀!"
  172. notdlyet.1    =C2"Die folgenden Files wurden noch nicht downgeloadet:"
  173. badboard.1    =C6"Dieses Brett wird bereits benutzt! Bitte das andere Hydra-Brett wΣhlen."cr||C2"Oder spiel doch mal ein Online-Game :)"
  174.  
  175. /********** Beginn **********/
  176.  
  177. /* User-Daten auslesen */
  178.  
  179. askuser
  180. user=result
  181. US_FR
  182. freiraum=result
  183. lng=1
  184. SPRACHE
  185. spr=result
  186. if spr="Deutsch" then lng=1 
  187. if spr="Englisch" then lng=0
  188. US_RA
  189. ratio=result
  190. US_BA
  191. linebaud=result
  192.  
  193. IF ~exists('mb:user/'user'/Hydra.BAD') then address command 'C:Makedir mb:user/'user'/Hydra.BAD'
  194. IF ~exists('mb:HydraLog') then address command 'C:Makedir mb:HydraLog'
  195. IF ~exists('mb:HydraLogFile') then address command 'C:Makedir mb:HydraLogFile'
  196.  
  197. /* Titel ausgeben */
  198.  
  199. SEND cls||cr||title.lng||cr
  200.  
  201. /* Auf welchem Port sind wir? Ist das Hydra-Brett schon belegt? */
  202.  
  203. pt=""
  204.  
  205. IF port~=0 then pt=port
  206.  
  207. /* Ist der User im richtigen Brett? Wenn ja, Brett belegen (Multiport) */
  208.  
  209. Brett=right(Brett,length(Brett)-2)
  210. Brett=left(Brett,length(Brett)-1)
  211.  
  212. IF upper(Brett)~=upper(Hydradir) then do
  213.     if upper(Brett)~=upper(Hydradir2) then do
  214.           send cr||nothyddir.lng
  215.           quit
  216.           exit
  217.     end
  218. end
  219.  
  220. If open(dummy,"T:"Brett,"R")=1 then do
  221.     send badboard.lng
  222.     close(dummy)
  223.     quit
  224.     exit
  225. end
  226.  
  227. open(dummy,"T:"Brett,"W")
  228. close(dummy)
  229.  
  230. /* Existiert das Hydra-Temp-Direktory? */
  231.  
  232. IF ~exists('hbin:'Brett'/temp/') then do
  233.           address command 'C:Makedir hbin:'Brett'/temp'
  234.           end
  235.  
  236. /* Gibt es unvollstΣndige Uploads? */
  237.  
  238. if exists('mb:user/'user'/Hydra.BAD/BAD-XFER.LOG') then do
  239.     address command 'list mb:user/'user'/Hydra.BAD/ QUICK NOHEAD FILES >T:SAVER.log'Port
  240.     open(flist,"T:SAVER.log"Port,"READ")
  241.     HydDir=readln(flist)
  242.     if HydDir='' then break
  243.     else do
  244.         send fincom.lng||C7||cr
  245.         open(bad,'mb:user/'user'/Hydra.BAD/BAD-XFER.LOG','R')
  246.             do until eof(bad)=1
  247.                 Logline = readln(bad)
  248.                 if length(LogLine)>5 then do
  249.                     parse var logline fname badname fsize x
  250.                     badsize=word(statef('mb:user/'user'/Hydra.BAD/'badname),2)
  251.                     send C6||left(fname,20," ")C7" - "C6||right(badsize,8," ")C7" "of.lng" "C6||right(fsize,8," ")C7" Bytes"cr
  252.                 end
  253.             end
  254.         close(bad)
  255.         SEND cr||cr||contUL.lng" "c7"["c1||b4||yep.lng||b0||c7"/"c3"N"c7"] "
  256.         BLUEREAD 1
  257.         jn=result
  258.         if upper(jn)="" then jn=yep.lng
  259.         if upper(jn)=yep.lng then do
  260.             address command 'move >NIL: mb:user/'user'/Hydra.BAD/BAD-XFER.#? to hbin:'Brett'/temp/'
  261.         end
  262.         else do
  263.             SEND cr||delnow.lng" "c7"["c3||yep.lng||c7"/"c1||b4"N"b0||c7"] "
  264.         BLUEREAD 1
  265.         jn=result
  266.         if upper(jn)="" then jn="N"
  267.         if upper(jn)=yep.lng then do
  268.             send cr||deliUL.lng
  269.             address command 'delete mb:user/'user'/Hydra.BAD/BAD-XFER.#?'
  270.             end
  271.         end
  272.     end
  273. end
  274.  
  275. close(flist)
  276.  
  277. send cr
  278.  
  279. /* Hydra-Send-Liste erstellen und Byte-Credits-Daten lesen */
  280.  
  281. bcred=0; num=0
  282.  
  283. send cr||C2||readsel.lng||cr
  284. send cr||C4"--"C7"[ "C2"Filename "C7"]"C4"--------------------.-"C7"[ "C2"Bytecredits "C7"]"C4"----------------"cr
  285.  
  286. if exists("mb:temp/merken"pt) then do
  287.     open(mlist,"mb:temp/merken"pt,"R")
  288.     open(Hydralst,"t:UL"port,"W")
  289.  
  290.     do while eof(mlist)=0
  291.         if eof(mlist)=0 then do
  292.             line=readln(mlist)
  293.             if line~="" then do
  294.                 num=num+1
  295.                 writeln(Hydralst,line)
  296.                 credz=readln(mlist)
  297.                 bcred=bcred+credz
  298.                 a=1
  299.                 name=right(line,a)
  300.                 do while left(name,1)~="/"
  301.                     a=a+1
  302.                     name=right(line,a)
  303.                 end
  304.                 name.num=right(line,a-1)
  305.                 loc.num=left(line,length(line)-length(name)+1)
  306.                 c=length(name.num)+3
  307.                 d=32-c
  308.                 if credz=0 then credz="Free Leech!"
  309.                 send "    "C7||name.num||insert(" "," ",0,d," ")||C4"|  "C7||insert(" ",credz,0,(12-length(credz))," ")||cr
  310.             end
  311.         end
  312.     end
  313.     close(mlist)
  314.     close(Hydralst)
  315. end
  316.  
  317. ELSE send C3"    *** "nosel.lng" ***"cr
  318.  
  319. send C4".--------------------.---------.--+--------------------------------"cr
  320. send C4"|                    `-"C7"[ "C2"Sum"C7":"C4"  |     "C7||insert(" ",bcred,0,(12-length(bcred))," ")||cr
  321. send C4"|                              `-----------------------------------"cr
  322. send C4"|"cr
  323. send C4"`------"C7"[ "C2"User-Ratio: "C3"1"C7":"C3||ratio||C4" ]-----"cr
  324.  
  325. send cr||cr||C2||dlspace.lng||C7||freiraum||C3" Bytes"cr||cr
  326.  
  327. /* Checken, ob User genug Download-Freiraum hat */
  328.  
  329. t=freiraum-bcred
  330.  
  331. if t<0 then do
  332.     send cr||cr||notenoughbc.lng||cr
  333.     if exists('hbin:'Brett'/temp/BAD-XFER.LOG') then address command 'move hbin:'Brett'/temp/BAD-XFER.#? to mb:user/'user'/Hydra.BAD/'
  334.     quit
  335.     exit
  336. end
  337.  
  338. /* User fragen, ob der Transfer tatsΣchlich gestartet werden soll */
  339.  
  340. SEND startxfer.lng
  341. BLUEREAD 1
  342. jn=result
  343. if jn="" then jn=yep.lng
  344. if upper(jn)="N" then do
  345.     if exists("T:UL"port) then address command "delete T:UL"port
  346.     if exists('hbin:'Brett'/temp/BAD-XFER.LOG') then address command 'move hbin:'Brett'/temp/BAD-XFER.#? to mb:user/'user'/Hydra.BAD/'
  347.     address command "delete t:"Brett
  348.         quit
  349.         exit
  350. end
  351.  
  352. /* Hydra-Transfer starten! */
  353.  
  354. send cr||cr||cr"   "inithyd.lng||"                         "abort.lng
  355.  
  356. if exists("mb:HydraLogFile/Hydra.log") then address command 'delete mb:HydraLogFile/Hydra.log'
  357.  
  358. if exists("T:UL"port) then address command 'c:hydracom speed 'baud' line 'linebaud' port 'Port' device 'Serdevice' dropdtr receive hbin:'Brett'/temp/ result mb:HydraLogFile/Hydra.Log nobell handshake hard send @T:UL'port
  359. else address command 'c:hydracom speed 'baud' line 'linebaud' port 'Port' device 'Serdevice' dropdtr receive hbin:'Brett'/temp/ result mb:HydraLogFile/Hydra.Log nobell handshake hard send'
  360.  
  361. /* Rⁿckmeldung des anderen Hydracom-Ports abfangen */
  362.  
  363. i=0
  364. ruck:
  365.     getchar
  366.     i=i+1
  367. if i<=100 then do
  368.     signal ruck
  369. end
  370.  
  371. /* HydraLog auswerten und Downloadfreiraum anpassen */
  372.  
  373. bcredz=0
  374.  
  375. open(log,'mb:HydraLogFile/Hydra.log','R')
  376.  
  377. if ExtraULDL=1 then do
  378.     if exists('mb:HydraLog/ULoads') then open(ul,'mb:HydraLog/ULoads','A')
  379.         else open(ul,'mb:HydraLog/ULoads','W')
  380.     if exists('mb:HydraLog/DLoads') then open(dl,'mb:HydraLog/DLoads','A')
  381.         else open(dl,'mb:HydraLog/DLoads','W')
  382.     end
  383.  
  384. if exists('mb:protokolle/UpDownloadprotokoll') then open(uldl,'mb:protokolle/UpDownloadprotokoll','A')
  385. else open(uldl,'mb:protokolle/UpDownloadprotokoll','W')
  386.  
  387. upps=0; downs=0; bytedown=0
  388.  
  389. do until eof(log)
  390.     Logline=readln(log)
  391.     parse var Logline transt fsize x x cps x x x x x fname x
  392.  
  393.     if transt='H' then do
  394.     do a=1 to num
  395.         if (loc.a||name.a)=fname then do
  396.             if ratio~=0 then bcredz=bcredz+fsize
  397.             If ExtraULDL=1 then writeln(dl,C2||datum' 'uhrzeit' 'C7||user||C6' 'left(cps,4,' ')' CPS 'left(name.a,16,' ')' 'right((fsize%1024),4,' ')' KB')
  398.             writeln(uldl,uhrzeit' 'datum' 'user' H-Download 'left(loc.a||name.a,50,' '))
  399.             downs=downs+1
  400.             call ChangeSelectList
  401.             bytedown=bytedown+fsize
  402.             end
  403.         end
  404.     end
  405.     else if transt='R' then do
  406.             If ExtraULDL=1 then writeln(ul,C2||datum' 'uhrzeit' 'C7||user||C6' 'left(cps,4,' ')' CPS 'left(fname,16,' ')' 'right((fsize%1024),4,' '))
  407.             if pip=1 then writeln(uldl,uhrzeit' 'datum' 'user' H-Upload   'left(fname,16,' ')' 'right((fsize),8,' ')' Bytes')
  408.             upps=upps+1
  409.             end
  410. end
  411.  
  412. close(log)
  413. close(ul)
  414. close(dl)
  415. close(uldl)
  416.  
  417. /* Download-Credits abziehen, Upload-Credits macht der Filechecker */
  418.  
  419. US_FR
  420. newfr=result-bcredz
  421. US_FR newfr
  422.  
  423. US_DO
  424. newdo=result+bytedown
  425. US_DO newdo
  426.  
  427. if upps=0 then do 
  428.     send cr||cr||C3||noupps.lng||cr 
  429.     end
  430. else send cr||lookatdir.lng||cr||cr
  431.  
  432. /* Files einsortieren mit FDizCheck */
  433.  
  434. address command 'list hbin:'Brett'/temp/ QUICK NOHEAD FILES >T:SAVER.log'Port
  435. if exists('T:SAVER.log'Port) then do
  436.     open(flist,"T:SAVER.log"Port,"READ")
  437.  
  438.     File=""
  439.     do while eof(flist)=0
  440.         if eof(flist)=0 then do
  441.             File=readln(flist)
  442.             if File~="" then do
  443.                 do z=1 to words(File)
  444.                 actfile=word(File,z)
  445.                 if left(actfile,8)="BAD-XFER" then address command 'move hbin:'Brett'/temp/BAD-XFER.#? to mb:user/'user'/Hydra.BAD/'
  446.                     else do
  447.                     send C7||found.lng||C2||actfile||cr
  448.                     if CheckDupe=1 then do
  449.                         call DupeCheck
  450.                         If Dupe=0 then address command 'rx c:fdiz-HydraFC 'port' /'Brett' hbin:'Brett'/temp/'File' 'lng
  451.                         end
  452.                     else address command 'rx c:fdiz-HydraFC 'port' /'Brett' hbin:'Brett'/temp/'File' 'lng
  453.                     end
  454.                 end
  455.             end
  456.         end
  457.     end
  458. end
  459.  
  460. /* Hydra-Select-File und Hydra.Logfile l÷schen */
  461.  
  462. address command "delete mb:HydraLogFile/Hydra.log"
  463. if exists('T:UL'port) then address command "delete T:UL"port
  464. if exists('T:SAVER.log'Port) then address command "Delete T:Saver.log"Port
  465.  
  466. /* Postprocessing Unit 
  467.  
  468. CHECKCARRIER
  469. carrier=result
  470. if carrier="NO CARRIER" then signal ncmail
  471.  
  472.  Hat der User unvollstΣndige Uploads hinterlassen? */
  473. if exists('mb:user/'user'/Hydra.BAD/BAD-XFER.LOG') then do
  474.     HydDir=showdir('mb:user/'user'/Hydra.BAD','f')
  475.     if HydDir='' then break
  476.     else do
  477.         send fincom.lng||C7||cr
  478.         open(bad,'mb:user/'user'/Hydra.BAD/BAD-XFER.LOG','R')
  479.             do until eof(bad)
  480.                 Logline = readln(bad)
  481.                 if logline~="" then do
  482.                     parse var logline fname badname fsize x
  483.                     badsize=word(statef('mb:user/'user'/Hydra.BAD/'badname),2)
  484.                     send C6||left(fname,20," ")C7" - "C6||right(badsize,8," ")C7" of "C6||right(fsize,8," ")C7" Bytes"cr
  485.                 end
  486.             end
  487.         close(bad)
  488.         SEND cr||cr||contUL2.lng" "c7"["c1||b4||yep.lng||b0||c7"/"c3"N"c7"] "
  489.         BLUEREAD 1
  490.         jn=result
  491.         if jn="" then jn=yep.lng
  492.         if upper(jn)="N" then do
  493.             SEND cr||delnow.lng" "c7"["c3||yep.lng||c7"/"c1||b4"N"b0||c7"] "
  494.             BLUEREAD 1
  495.             jn=result
  496.             if upper(jn)="" then jn="N"
  497.             if upper(jn)=yep.lng then do
  498.                 send deliUL.lng
  499.                 address command 'delete mb:user/'user'/Hydra.BAD/BAD-XFER.#?'
  500.                 end
  501.             end
  502.     end
  503. end
  504. send cr
  505.  
  506. /* Sind noch nicht gedownloadete Files vorhanden? */
  507.  
  508. if ~exists("mb:temp/merken"pt) & (downs=0) then signal ende
  509.  
  510. if ~exists("mb:temp/merken"pt) then do
  511.             send cr||dlsuccess.lng||cr
  512.             signal ende
  513.             end
  514.  
  515. send cls||cr||title.lng||cr||cr
  516.  
  517. send notdlyet.lng||cr
  518. send cr||C4"--"C7"[ "C2"Filename "C7"]"C4"--------------------.-"C7"[ "C2"Bytecredits "C7"]"C4"----------------"cr
  519.  
  520. num=0
  521. open(mlist,"mb:temp/merken"pt,"R")
  522.     do while eof(mlist)=0
  523.         if eof(mlist)=0 then do
  524.             line=readln(mlist)
  525.             if line~="" then do
  526.                 num=num+1
  527.                 credz=readln(mlist)
  528.                 a=1
  529.                 name=right(line,a)
  530.                 do while left(name,1)~="/"
  531.                     a=a+1
  532.                     name=right(line,a)
  533.                 end
  534.                 name.num=right(line,a-1)
  535.                 c=length(name.num)+3
  536.                 d=32-c
  537.                 if credz=0 then credz="Free Leech!"
  538.                 send "    "C7||name.num||insert(" "," ",0,d," ")||C4"|  "C7||insert(" ",credz,0,(12-length(credz))," ")||cr
  539.             end
  540.         end
  541.     end
  542.     close(mlist)
  543.  
  544. send cr||C2||asksl.lng" "c7"["c3||b4||yep.lng||b0||c7"/"c1"N"c7"] "
  545.  
  546. BLUEREAD 1
  547. jn=result
  548. if upper(jn)="" then jn=yep.lng
  549. if upper(jn)~=yep.lng then address command 'delete mb:temp/merken'pt
  550.  
  551. send cr
  552.  
  553. /* Ende!!! */
  554.  
  555. ende:
  556. send cr||C2||thanx.lng||Res||cr
  557. address command "delete t:"Brett
  558. quit
  559. exit
  560.  
  561. /* DupeCheck */
  562.  
  563. DupeCheck:
  564. if dtfile="" then return
  565. Dupe=0
  566. send cr||dupe.lng
  567.     address command 'search 'dtfile' 'file' >ram:dupechk'port
  568.     open(i,"ram:dupechk"port,"R")
  569.     send "."
  570.     len=seek(i,0,"E")
  571.     send "."
  572.     close(i)
  573.     send "."
  574.     if len>0 then do
  575.         send foundentry.lng
  576.         Call MoveFileToSchrott
  577.         Dupe=1
  578.     end
  579.     if len=0 then do
  580.     send C3"OK!"cr
  581.     address command  "delete ram:dupechk"port
  582.     end
  583. return
  584.  
  585. /* Syntax-Fehler-Routine */
  586.  
  587. syntax:
  588. send "Error occured! Line: "sigl" --> "rc""errortext(rc)||cr
  589. send "Please notify the Sysop, giving him Line- and Error-Nr. !"
  590. quit
  591. exit
  592.  
  593. /* NO CARRIER - Brief an User und Sysop */
  594.  
  595. ncmail:
  596. if exists('mb:user/'user'/Hydra.BAD/BAD-XFER.LOG') then do
  597.     call nocarriermailuser
  598.     muser="SYSOP"
  599.     call nocarriermailsysop
  600.     if sopvtr=1 then do
  601.         open(vtr,"mb:user/sysop/vertreter","R")
  602.             do until eof(vtr)
  603.             muser=readln(vtr)
  604.                 if muser~="" then call nocarriermailsysop
  605.             end
  606.         close(vtr)
  607.     end
  608. end
  609. address command "delete t:"Brett
  610. quit
  611. exit
  612.  
  613. nocarriermailsysop:
  614.  
  615. if exists("mb:user/"muser"/.index") then open(index,"mb:user/"muser"/.index","A")
  616.                   else open(index,"mb:user/"muser"/.index","W")
  617. if exists("mb:user/"muser"/.txt") then open(txt,"mb:user/"muser"/.txt","A")
  618.                 else open(txt,"mb:user/"muser"/.txt","W")
  619.     seek(index,0,E)
  620.     lentxt=seek(txt,0,E)
  621.  
  622.     writeln(index,lentxt)
  623.     writeln(index,filedatum"    1 Asc Hydra-System     <<< Incomplete Uploads >>>")
  624.     close(index)
  625.  
  626. /* Text schreiben */
  627.  
  628.     writeln(txt,"Absender  : Hydra-System")
  629.     writeln(txt,"Betreff   : <<< Incomplete Upload >>>")   
  630.     writeln(txt,"Datum     : "||datum)
  631.     writeln(txt,"Uhrzeit   : "||uhrzeit)
  632.     writeln(txt,"Zeilen    : 31")
  633.     writeln(txt,"")
  634.     writeln(txt,"")
  635.     writeln(txt,"#Hallo "muser", der User %a2"||user||"%a6 hat begonnen, ein File")
  636.     writeln(txt,"zu uppen, da▀ er wegen eines Carrierverlustes nicht zuende")
  637.     writeln(txt,"uppen konnte!")
  638.     writeln(txt,"")
  639.     writeln(txt,"")
  640.     writeln(txt,"Das File hei▀t:")
  641.     writeln(txt,"")
  642.     open(bad,'mb:user/'user'/Hydra.BAD/BAD-XFER.LOG','R')
  643.         do until eof(bad)
  644.         Logline = readln(bad)
  645.                 parse var logline fname badname fsize x
  646.                 writeln(txt,"#%a7"left(fname,20," "))
  647.         end
  648.     close(bad)
  649.     close(txt)
  650. return
  651.  
  652. nocarriermailuser:
  653.     if exists("mb:user/"user"/.index") then open(index,"mb:user/"user"/.index","Append")
  654.                       else open(index,"mb:user/"user"/.index","Write")
  655.     if exists("mb:user/"user"/.txt") then open(txt,"mb:user/"user"/.txt","Append")
  656.                     else open(txt,"mb:user/"user"/.txt","Write")
  657.         seek(index,0,E)
  658.         lentxt=seek(txt,0,E)
  659.         
  660.         writeln(index,lentxt)
  661.         writeln(index,filedatum"    1 Asc Hydra-System     <<< Incomplete Uploads >>>")
  662.         close(index)
  663.  
  664.         writeln(txt,"Absender  : Hydra-System")
  665.         writeln(txt,"Betreff   : <<< Incomplete Upload >>>")   
  666.         writeln(txt,"Datum     : "||datum)
  667.         writeln(txt,"Uhrzeit   : "||uhrzeit)
  668.         writeln(txt,"Zeilen    : 31")
  669.         writeln(txt,"")
  670.         writeln(txt,"")
  671.         writeln(txt,t1.lng||user||"%a6 !")
  672.         writeln(txt,t2.lng||datum||t3.lng)
  673.         writeln(txt,t4.lng)
  674.         writeln(txt,t5.lng)
  675.         writeln(txt,"")
  676.         writeln(txt,"")
  677.         writeln(txt,t6.lng)
  678.         writeln(txt,"")
  679.  
  680.     open(bad,'mb:user/'user'/Hydra.BAD/BAD-XFER.LOG','R')
  681.         do until eof(bad)
  682.         Logline = readln(bad)
  683.                 parse var logline fname badname fsize x
  684.                 writeln(txt,"#%a7"left(fname,20," "))
  685.         end
  686.         writeln(txt,"")
  687.         writeln(txt,t7.lng)
  688.     close(bad)
  689.     close(txt)
  690. return
  691.  
  692. /* File nach Schrott moven */
  693.  
  694. MoveFileToSchrott:
  695. address command 'c:move hbin:'Brett'/temp/'File' to mb:schrott'
  696. muser="SYSOP"
  697. call MovedMail
  698. if sopvtr=1 then do
  699.     open(vtr,"mb:user/sysop/vertreter","R")
  700.         do until eof(vtr)
  701.         muser=readln(vtr)
  702.             call MovedMail
  703.         end
  704.     close(vtr)
  705. end
  706.  
  707.  
  708. MovedMail:
  709.  
  710. if ~exists("mb:user/"muser"/userdaten") then return
  711.  
  712. if exists("mb:user/"muser"/.index") then open(index,"mb:user/"muser"/.index","A")
  713.                   else open(index,"mb:user/"muser"/.index","W")
  714. if exists("mb:user/"muser"/.txt") then open(txt,"mb:user/"muser"/.txt","A")
  715.                 else open(txt,"mb:user/"muser"/.txt","W")
  716.  
  717.     seek(index,0,E)
  718.     lentxt=seek(txt,0,E)
  719.     
  720.     writeln(index,lentxt)
  721.     writeln(index,filedatum"    1 Asc Hydra-Upload     <<< Deleted File >>>")
  722.     close(index)
  723.  
  724. /* Text schreiben */
  725.  
  726.     writeln(txt,"Absender  : Hydra-Upload")
  727.     writeln(txt,"Betreff   : <<< Deleted File >>>")   
  728.     writeln(txt,"Datum     : "||datum)
  729.     writeln(txt,"Uhrzeit   : "||uhrzeit)
  730.     writeln(txt,"Zeilen    : 31")
  731.     writeln(txt,"")
  732.     writeln(txt,"")
  733.     writeln(txt,"#Hallo "muser", der User %a2"||user||"%a6 hat ein File geuppt,")
  734.     writeln(txt,"das schon mal da war und deshalb gel÷scht wurde!")
  735.     writeln(txt,"")
  736.     writeln(txt,"#%a2Das File hei▀t: %a3"File)
  737.     writeln(txt,"")
  738.     writeln(txt,"#Es befindet sich nun in %a3mb:schrott/%a6.")
  739.     close(txt)
  740. return
  741.  
  742. /* EintrΣge der Select-Liste Σndern */
  743.  
  744. ChangeSelectList:
  745.  
  746. chng=0
  747. open(mlist,"mb:temp/merken"pt,"R")
  748. open(mlist2,"t:merken"pt,"W")
  749.     do while eof(mlist)=0
  750.         if eof(mlist)=0 then do
  751.             line=readln(mlist)
  752.             if line~="" then do
  753.                 if line~=fname then do
  754.                     writeln(mlist2,line)
  755.                     credz=readln(mlist)
  756.                     writeln(mlist2,credz)
  757.                     end
  758.                 else do 
  759.                     chng=1
  760.                     readln(mlist)
  761.                 end
  762.             end
  763.         end
  764.     end
  765. close(mlist)
  766. close(mlist2)
  767.  
  768. if chng=1 then address command 'copy t:merken'pt' to mb:temp/'
  769.  
  770. open(i,"mb:temp/merken"pt,"R")
  771.     len=seek(i,0,"E")
  772. close(i)
  773. if len=0 then do
  774.     address command  "delete mb:temp/merken"pt
  775. end
  776.  
  777. address command 'delete t:merken'pt
  778. return
  779.